package com.yusheng.tr.multi.controller;


import com.yusheng.domain.R;
import com.yusheng.tr.multi.service.impl.AllService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
@Tag(name = "拉取、同步文件",description = "拉取、同步文件")
@Slf4j
public class AllController {

    @Autowired
    private AllService allService;

    @GetMapping("/pull")
    @Operation(description="拉取文件")
    public R test() throws Exception {
        allService.test();
        return R.ok();
    }
    @PostMapping("/push")
    @Operation(description="同步文件")
    @Parameter(name = "json",description = "要同步的文件")
    public R<?> push(String json) throws Exception {
        log.info("***********{}",json);
        allService.push(json);
        return R.ok();
    }
}
